


//登录
$('#login').on('click',function(){
	var phone = $('#phone').val().trim();
	var password = $('#password').val().trim();
	if(!(/^(15|13|18)\d{9}$/).test(phone)){
		alert('请填写正确的手机格式');
	}else if(phone == '' || password == ''){
		alert('请填写手机号和密码');
	}else{
		$.ajax({
			type:"POST",
			url : "/maidian/user/loginAction.json",
			dataType : "json",
			data : {
				"phone" :phone,
				"password" :password
			},
			success : function(data) {
				if(data.code=="-200"){
					alert('账号或密码错误');
				}else if(data["code"] == "200") {
					//跳到发送验证码页面
					window.location.href="/maidian/user/sendVerifyCode.htm";
				}else if(data["code"] == "-300") {
					alert('登录失败请重试');
				}
			}
		})
	}
})


//友情提示
$('.queren').on('click',function(){
	$('.mui-active').hide();
	$('#errorTip').hide();
})